First line a of a file not printing in a function